package com.launcher.decorator;

import javax.persistence.Entity;

import com.launcher.Rocket;


@Entity
public class Engine extends RocketDecorator implements IEngine
{
	private int power = 0;
	
	public Engine(Rocket decoratedRocket)
	{
		super(decoratedRocket);
	}
	
	public Engine()
	{
		super(null);
	}
	
	public void setPower(int power)
	{
        this.power = power;
    }
	
	public int getPower()
	{
        return power;
    }

	@Override
	public String getParts()
	{
		return super.getParts() + ": " + power;
	}
	
	public Engine clone()
	{
		Stage stage = ((Stage) getRocketDecorator()).clone();
		Engine engine = new Engine(stage);
		engine.setCost(getCost());
		engine.setMass(getMass());
		engine.setPower(getPower());
		
		return engine;
	}
}
